class Function{
  def addOne(list:List[Int]):List[Int]={
    list.map(x=>x+1)
    }
  def filterEven(list:List[Int]):List[Int]={
    list.filter(_%2==0)
    }
  def mapReduce(list:List[Int])(mapF:Int => Int)(reduceF:(Int,Int) =>Int):Int={
    list.map(mapF).reduce(reduceF)
    }
}
val function=new Function()
val list:List[Int]=List(1,2,3,4,5,6,7,8,9,10)

//val addOneList=addOne(list)
println(function.addOne(list))

//val evenList=filterEven(list)
println(function.filterEven(list))

//val sum=mapReduce(list)(x=>x*2)(_+_)
println(function.mapReduce(list)(x=>x*2)(_+_))

